import Vue from 'vue'
import VueRouter from 'vue-router'

// 引入路由
const Login = () => import('../components/login/Login.vue')
const Home = () => import('../components/home/Home.vue')
// 管理员模块
const ManageUserVerify = () => import('../components/manage/UserVerify.vue')
const ManageArticle = () => import('../components/manage/Article.vue')
const ManageCourse = () => import('../components/manage/Course.vue')
const ManageUser = () => import('../components/manage/User.vue')
// 研究生模块
const StudentArticleList = () => import('../components/student/ArticleList.vue')
// const StudentCourse = () => import('../components/student/Course.vue')
const StudentSelf = () => import('../components/student/Self.vue')
const StudentArticleEdit = () => import('../components/student/ArticleEdit.vue')
const StudentCourseList = () => import('../components/student/CourseList.vue')
const StudentCourseSection = () => import('../components/student/CourseSection.vue')

Vue.use(VueRouter)

const routes = [{
  path: '/',
  redirect: '/login'
}, {
  path: '/login',
  component: Login
}, {
  path: '/home',
  component: Home,
  children: [
    {
      path: 'manage/userverify',
      component: ManageUserVerify
    }, {
      path: "manage/article",
      component: ManageArticle
    }, {
      path: "manage/course",
      component: ManageCourse
    }, {
      path: "manage/user",
      component: ManageUser
    }, {
      path: "student/self",
      component: StudentSelf
    }, {
      path: "student/articleList",
      component: StudentArticleList
    }, {
      path: "student/articleEdit",
      component: StudentArticleEdit
    }, {
      path: "student/courseList",
      component: StudentCourseList
    }, {
      name: "courseSection",
      path: "student/courseSection",
      component: StudentCourseSection
    }
  ]
}]


const router = new VueRouter({
  routes,
  mode: 'history'
})


export default router